package com.fz.controller;

import com.fz.entity.PageView;
import com.fz.service.PageViewService;
import com.fz.vo.ResultVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 存储用户与公告关联信息 前端控制器
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@RestController
@RequestMapping("/tPageview")
public class PageViewController {
    @Resource
    PageViewService tPageviewService;
    @GetMapping("/list")
    List<PageView> list(){return tPageviewService.list();}
    @PostMapping("/view")
    ResultVo<Boolean> view(Long id, Integer status, Integer statu){
        return ResultVo.success(tPageviewService.view(id,status,statu),"公告已通过查看");
    }
    @PostMapping("/add")
    ResultVo<Boolean>add(Long userId, Long noticeId){
        return ResultVo.success(tPageviewService.add(userId,noticeId));
    }
    @PostMapping("/panduan")
    ResultVo<Boolean> panduan(Long userId,Long noticeId){
        return ResultVo.success(tPageviewService.panduan(userId,noticeId));
    }

}
